<?php
/**
 * Backup the mysql database daily when a user/bot visits
 * the site.
 *
 * @package default
 */
date_default_timezone_set ('Europe/Amsterdam');
error_reporting(-1);

$sTime = date ('d-m-Y');

chdir ('public/backups');

if (!is_file ($sTime . '.sql'))
{
	system("mysqldump --user " . $_CONFIG['pPDO']['uname'] . " --password=" . $_CONFIG['pPDO']['pass'] . " " . $_CONFIG['pPDO']['db'] . " > " . $sTime . ".sql");
}